﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        Ticket.GetewmPic("guochangle");
    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        string order_id = "14061331299548383142";
        DBHelper d = new DBHelper();
        string buyer_openid = "";
        string order_status = "";
        string product_name = "";
        string product_price = "";
        string product_count = "";
        string order_total_price = "";

        Ticket.GetOrder(order_id, ref buyer_openid, ref order_status, ref product_name, ref product_price, ref product_count, ref order_total_price);


        if (order_status == "2" || order_status == "3" || order_status == "5")
        {
            int i = d.getCount("wx_order", "order_id='" + order_id + "'");
            if (i == 0)
            {
                string sql = "insert into wx_order(order_id,buyer_openid,product_name,product_price,product_count,order_total_price,order_status) values('" + order_id + "','" + buyer_openid + "',N'" + product_name + "','" + product_price + "','" + product_count + "','" + order_total_price + "','" + order_status + "')";
                d.executeNoneQuery(sql);
            }
        }
    }
}